import React, { useState } from 'react'
import { NavLink, Outlet } from 'react-router-dom'

export default function Home() {
  const [sum, setSum] = useState(1)

  return (
    <div>
      <h3>我是Home的内容</h3>
      <div>
        <ul className="nav nav-tabs">
          <li>
            {/* 路径要么写全，要么只写当前这一级的路径（不带斜杠），react回去自动将这一级的路径添加到父路径上 */}
            <NavLink to="news">News</NavLink>
          </li>
          <li>
            <NavLink to="message">Message</NavLink>
          </li>
        </ul>
        {/* 路由展示，相当于router-view */}
        <Outlet></Outlet>
      </div>
    </div>
  )
}
